<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加图片</title>
<link href="../Public/js/uploadify/example/css/default.css" rel="stylesheet" type="text/css" />
<link href="../Public/js/uploadify/example/css/uploadify.css" rel="stylesheet" type="text/css" />
<link href="../Public/js/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../Public/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../Public/js/uploadify/swfobject.js"></script>
<script type="text/javascript" src="../Public/js/uploadify/jquery.uploadify.v2.1.0.min.js"></script>
<script type="text/javascript" src="../Public/js/public.js"></script>
<script type="text/javascript" src="../Public/photo/js/interface.js"></script>
  <script type="text/javascript">
        $().ready(function()
        {
            $("#uploadify").uploadify({
                'uploader': '../Public/js/uploadify/uploadify.swf',
                'script': '{:U('Upload/photofile')}',
                'cancelImg': '../Public/js/uploadify/cancel.png',
                'folder': '../Public/upload',
                'queueID': 'fileQueue', 
                'auto': false,
                'fileDesc' : '支持格式:jpg/gif/jpeg/png/bmp.',
                'fileExt'  : '*.jpg;*.gif;*.jpeg;*.png;*.bmp',//允许的格式 
                'multi': true,
                'onError': function(event, queueID, fileObj) 
                {  
                   alert("文件:" + fileObj.name + "上传失败"); 
                },
                'onCancel': function(event, queueID, fileObj)
                {  
                   alert("取消了" + fileObj.name);  
                },              
                'onAllComplete':function(event,data){
                   alert("上传成功" );
                   $('#uploadify').uploadifySettings('scriptData', { "PHPSESSID": "<?php echo session_id();?>"});
                 }           
            });
        });  
            
   //弹出相册名字
   function createAlbum()
   {
     var albumname = prompt("请创建的相册名称:","");
     if(albumname!=null){
        var url = "addAlbum/albumname/"+albumname; 
        window.location.href="{:U('"+url+"')}";
     }else{
        alert("您确认取消新相册创建");
     }
   }
    function selectitem(index){
   switch(index){
    case 0:
    window.location.href="{:U('Public/tohome')}"
    break;
    case 1:
    window.location.href="{:U('Upload/uploadpicture')}"
    break;
    case 2:
    window.location.href="{:U('Note/addBlog')}"
    break;
    case 3:
    window.location.href="{:U('First/Index')}"
    break;
    case 4:
    window.location.href="{:U('Favorite/Index')}"
    break;
    case 5:
    window.location.href="{:U('Video/addVideo')}"
    break;
    case 6:
    window.location.href="{:U('Growth/Index')}"
    break;
    case 7:
    window.location.href="{:U('Timeshow/Index')}"
    break;
   }
}
   
    </script>

<style>
a{
	text-decoration: none;
	}
div{
	margin:0px;
	margin-left:auto;
	margin-right:auto;
		/*border:thin;border-color:#Ff0000; */
	}
body {
	height:298px;
	background:#ffffff;
	margin:0px;	
	margin-left:2%;
}

input{
	background:#f2fbfe;
	}
textarea{
		background:#f2fbfe;
        resize:none;
	}
.title_r{
	 float:left;
     background:#ecf9fe;
	 border:#dee4e3 thin solid;
	 border-left:none;
	 border-right:none;
	 width:75%;
	 height:30px;
	 height:30px; 
	 text-align:center;
     cursor:pointer;
	}
#upload_bu{
	background:url(../Public/photo/image/uploadvideo.png) no-repeat left center;
	width:100%;
	height:40px;
	cursor:pointer;
	float:left;
	}	
 .options{
	height:30px;
	width:170px;
	border-bottom:dotted #e3e3e3 1px;
	cursor:pointer;
	} 
 .myfontstyle{
    font-family:'黑体';
    letter-spacing:1px;
}   
</style>

</head>

<body style="text-align:center; ">
<div style="width:98%;margin-left:2%;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td  style="width:65%;height:30px;" ></td>
    <td  style="width:7%;" rowspan="3"><div style="float:left;width:100%;background:url(../Public/photo/image/m_line.png) no-repeat center center;height:350px; "></div></td>
    <td  style="width:28%;">
    </td>
  </tr>

  <tr>
    <td rowspan="3" valign="top">    
<div style="width:97%; background:#ecf8fe; border:#dbdcdd thin solid; height:330px; float:left;"> 


  <div class='title_r myfontstyle' style='width:15%;background:#d8f2fe url(../Public/photo/image/grayline.png) no-repeat right center;line-height:30px;font-size:11pt;color:#209593; font-weight:bold;' >
  图片上传
  </div>
  <form id="form1" name="form1" method="post" action="{:U('/Upload/add_photo')}" enctype="multipart/form-data">  
  <div class='title_r' style="width: 85%;" ><a href="#" onclick="createAlbum()" style="line-height:30px;font-size:9pt;color:#6c6c6c;">创建新相册</a>
      <select id="album" name="album">
        <option value="0">请选择相册</option>
        <volist name='list' id='vo'>
           <option value="{$vo.id}">{$vo.albumname}</option>
        </volist>
      </select>
  </div>

  
  <div id='tabid2' style="width:90%;height:80px;">
  
  
     <div class="myfontstyle" style="width:100%;height:25px;clear:both;"></div>
       <b style="color: #219593;font-size:12pt;">图片名称：</b><input name="photo_tag" type="text" style="height:26px;width:300px;" value="" /><br/>
        <b style="color: #219593;font-size:12pt;">图片描述：</b><input id="ph_describe" name="ph_describe" type="text" style="height:26px;width:300px;" value="" /><br/>
        <div style="width:100%;height:25px;clear:both;"></div>
        <input type="file" name="photo"/> <input name="describe" type="submit" value="上传" style="margin-left:40px;width:80px;height: 26px;cuRsor:pointer" /><br/>
      <!--  <div><a href="javascript:upload()"><img src="../Public/photo/image/upload.png"/></a></div>-->
    </form>
</div>
  


</td>
    <td  style="width:28%;font-size:9pt; text-align:left;height:30px;" valign="top">    
    <div class="myfontstyle" style="float:left;width:210px;">
   	   <div style="background:url(../Public/photo/image/back.png) no-repeat;width:210px;height:214px;padding-top:50px;">
    <!--	<div class="myfontstyle" style="width:80%;color:#A0A0A0;font-size:10pt;">&nbsp;&nbsp;您可以在这里上传照片，这样的功能并不特殊，您或许已经在网络上传过无数的照片了，
不过，每一张照片都应该有它的专属故事，Tang照片必须是这样的：这张照片的故事我忘不了，它使我想起了那天宝宝…… 
       </div> -->    
    </div>
   </div>
  
    <div  id="role" style="float:left;background:url(../Public/child/image/v_line.png) bottom left repeat-x;width:70%;clear:both;">
    <div class="options" style="background:url(../Public/child/image/home.png) no-repeat;" onclick="selectitem(0)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addphoto.png) no-repeat;" onclick="selectitem(1)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addvideo.png) no-repeat;" onclick="selectitem(5)"></div>	
    	<div class="options" style="background:url(../Public/child/image/marker.png) no-repeat;" onclick="selectitem(3)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addfavourite.png) no-repeat;" onclick="selectitem(4)"></div>	
    	<div class="options" style="background:url(../Public/child/image/addnote.png) no-repeat;" onclick="selectitem(2)"></div>	
    	<div class="options" style="background:url(../Public/child/image/grow.png) no-repeat;" onclick="selectitem(6)"></div>	
    	<div class="options" style="background:url(../Public/child/image/timeshow.png) no-repeat;" onclick="selectitem(7)"></div>		
    </div>
</td>
  </tr>
</table>

</div>
    <img src="../Public/photo/image/flower.png" style="position:absolute;right:0;bottom:0; z-index:-50;" />
</body>
</html>